
<div id="actionbar"  class="button-group">
    <a href="{:url('order/add')}" class="button button-blue"> <i class="iconfont icon-add_icon"></i>创建订单</a>

    <div class="fn-right">
        <form class="input-group" id="form" action="{:url('order/index')}" method="get">
            <input type="hidden" name="state" value="{$state}">
            <input placeholder="开始时间" class="input w100 ui-date" type="text" name="starttime" value="{$starttime}" autocomplete="off"/>
            <input placeholder="结束时间" class="input w100 ui-date" type="text" name="endtime" value="{$endtime}" autocomplete="off"/>
            <input placeholder="标题" class="input w200" type="text" name="keyword" value="{$keyword}"/>
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        <a href="{:url('order/index',['time' => 1,'state'=>$state])}" class="button{$time==1?' button-violet':''}">今日</a>
        <a href="{:url('order/index',['time' => 2,'state'=>$state])}" class="button{$time==2?' button-violet':''}">昨日</a>
        <a href="{:url('order/index',['time' => 30,'state'=>$state])}" class="button{$time==30?' button-violet':''}">本月</a>
        <a href="{:url('order/index',['time' => 60,'state'=>$state])}" class="button{$time==60?' button-violet':''}">上月</a>
    </div>
    <div class="fn-right" style="margin-right: 10px">
        <a href="{:url('order/index',['state'=>0,'time'=>$time])}" class="button{if $state == 0} button-green{/if}">新工单</a>
        <a href="{:url('order/index',['state'=>1,'time'=>$time])}" class="button{if $state == 1} button-green{/if}">待付费</a>
        <a href="{:url('order/index',['state'=>2,'time'=>$time])}" class="button{if $state == 2} button-green{/if}">待评价</a>
        <a href="{:url('order/index',['state'=>3,'time'=>$time])}" class="button{if $state == 3} button-green{/if}">已关闭</a>
    </div>
</div>
<table class="table">
    <thead>
    <tr>
        <th class="w80 fn-tac">工程师</th>
        <th>标题</th>
        <th class="w80 fn-tac">紧急</th>
        <th class="w80 fn-tac">状态</th>
        <th class="w140 fn-tac">用户</th>
        <th class="w160 fn-tac">更新时间</th>
        <th class="w190 fn-tac">操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $lists as $vo}
    <tr>
        <td class="fn-tac">{$vo.engineer.title}</td>
        <td><a href="javascript:openwin('{:url('order/detail',['id' => $vo.id])}')">{$vo.title}</a></td>
        <td class="fn-tac">{if $vo.urgent == 1}<span class="badge bg-blue m3">中等</span>{elseif $vo.urgent == 2}<span class="badge bg-yellow m3">危险</span>{elseif $vo.urgent == 3}<span class="badge bg-red m3">超急</span>{else /}<span class="badge bg-danger m3">一般</span>{/if}</td>
        <td class="fn-tac">{if $vo.state == 1}<span class="badge bg-red m3">待付费</span>{elseif $vo.state == 2}<span class="badge bg-yellow m3">待评价</span>{elseif $vo.state == 3}<span class="badge bg-danger m3">已关闭</span>{else /}<span class="badge bg-green m3">新工单</span>{/if}</td>
        <td class="fn-tac">{$vo.user.nickname}</td>
        <td class="fn-tac">{$vo.update_time|date='Y-m-d H:i'}</td>
        <td class="fn-tac button-group">
            {if $vo.state <= 1}
                <a class="button isend" url="{:url('order/end',['id'=>$vo.id])}" href="javascript:;">完成付款</a>
            {else}
                <a class="button button-disabled"  href="javascript:;">完成付款</a>
            {/if}
            <a class="button" href="{:url('order/edit',['id'=>$vo.id])}">编辑</a>
            <a class="button isDel" url="{:url('order/delete',['id'=>$vo.id])}" href="javascript:;">删除</a>
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
    Do('base','layer','form','date', function () {
        $('#form').isForm({'types':1});
        $('.isDel').isDel();
        $('.isend').actUrl();
    })
</script>